home *** CD-ROM | disk | FTP | other *** search
/ Aminet 32 / Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso / Aminet / comm / mail / PegMail.lha / PegMail / source / pegmail_gui.c < prev    next >
C/C++ Source or Header  |  1999-03-28  |  4KB  |  182 lines

  1. #ifndef MAKE_ID
  2. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  3. #endif
  4.  
  5. #ifdef _DCC
  6. #define __inline
  7. #endif
  8.  
  9. #include "pegmail_gui.h"
  10.  
  11. struct ObjApp * CreateApp(void)
  12. {
  13.     struct ObjApp * Object;
  14.  
  15.     APTR    GROUP_ROOT_0, GR_grp_0, GR_grp_1, LA_label_1, GR_grp_1CC, LA_label_4;
  16.     APTR    GR_grp_2, LA_label_3, REC_label_0, REC_label_2, GR_grp_3;
  17.  
  18.     if (!(Object = AllocVec(sizeof(struct ObjApp), MEMF_PUBLIC|MEMF_CLEAR)))
  19.         return(NULL);
  20.  
  21.     Object->STR_TX_label_0 = "Idle...";
  22.  
  23.     LA_label_1 = Label("Source");
  24.  
  25.     Object->STR_PA_label_0 = String("", 80);
  26.  
  27.     Object->PA_label_0 = PopButton(MUII_PopFile);
  28.  
  29.     Object->PA_label_0 = PopaslObject,
  30.         MUIA_HelpNode, "PA_label_0",
  31.         MUIA_Popasl_Type, 0,
  32.         MUIA_Popstring_String, Object->STR_PA_label_0,
  33.         MUIA_Popstring_Button, Object->PA_label_0,
  34.       //ASLFR_Locale, TRUE,
  35.       ASLFR_TitleText, "Please select source file(s)",
  36.       ASLFR_DoMultiSelect, TRUE,
  37.         MUIA_Popasl_StopHook, &aslob_hook,
  38.  
  39.     End;
  40.  
  41.     GR_grp_1 = GroupObject,
  42.         MUIA_HelpNode, "GR_grp_1",
  43.         MUIA_Group_Horiz, TRUE,
  44.         Child, LA_label_1,
  45.         Child, Object->PA_label_0,
  46.     End;
  47.  
  48.     LA_label_4 = Label("Destination");
  49.  
  50.     Object->STR_PA_label_1 = String("", 80);
  51.  
  52.     Object->PA_label_1 = PopButton(MUII_PopFile);
  53.  
  54.     Object->PA_label_1 = PopaslObject,
  55.         MUIA_HelpNode, "PA_label_1",
  56.         MUIA_Popasl_Type, 0,
  57.         MUIA_Popstring_String, Object->STR_PA_label_1,
  58.         MUIA_Popstring_Button, Object->PA_label_1,
  59.  
  60.  
  61.     End;
  62.  
  63.     GR_grp_1CC = GroupObject,
  64.         MUIA_HelpNode, "GR_grp_1CC",
  65.         MUIA_Group_Horiz, TRUE,
  66.       MUIA_ShowMe, FALSE,
  67.         Child, LA_label_4,
  68.         Child, Object->PA_label_1,
  69.     End;
  70.  
  71.     LA_label_3 = Label("Status");
  72.  
  73.     Object->TX_label_0 = TextObject,
  74.         MUIA_Background, MUII_TextBack,
  75.         MUIA_Frame, MUIV_Frame_Text,
  76.         MUIA_Text_Contents, Object->STR_TX_label_0,
  77.     End;
  78.  
  79.     GR_grp_2 = GroupObject,
  80.         MUIA_HelpNode, "GR_grp_2",
  81.         MUIA_Group_Horiz, TRUE,
  82.         Child, LA_label_3,
  83.         Child, Object->TX_label_0,
  84.     End;
  85.  
  86.     REC_label_0 = RectangleObject,
  87.         MUIA_Rectangle_HBar, TRUE,
  88.         MUIA_FixHeight, 8,
  89.     End;
  90.  
  91.     Object->GA_label_1 = GaugeObject,
  92.         GaugeFrame,
  93.         MUIA_HelpNode, "GA_label_1",
  94.         MUIA_FixHeight, 10,
  95.         MUIA_Gauge_Horiz, TRUE,
  96.         MUIA_Gauge_Max, 100,
  97.     End;
  98.  
  99.     REC_label_2 = RectangleObject,
  100.         MUIA_Rectangle_HBar, TRUE,
  101.         MUIA_FixHeight, 8,
  102.     End;
  103.  
  104.     Object->BT_quit = SimpleButton("Quit");
  105.  
  106.     Object->BT_conv = SimpleButton("Convert");
  107.  
  108.     GR_grp_3 = GroupObject,
  109.         MUIA_HelpNode, "GR_grp_3",
  110.         MUIA_Group_Horiz, TRUE,
  111.         Child, Object->BT_quit,
  112.         Child, Object->BT_conv,
  113.     End;
  114.  
  115.     GR_grp_0 = GroupObject,
  116.         MUIA_HelpNode, "GR_grp_0",
  117.         Child, GR_grp_1,
  118.         Child, GR_grp_1CC,
  119.         Child, GR_grp_2,
  120.         Child, REC_label_0,
  121.         Child, Object->GA_label_1,
  122.         Child, REC_label_2,
  123.         Child, GR_grp_3,
  124.     End;
  125.  
  126.     GROUP_ROOT_0 = GroupObject,
  127.         Child, GR_grp_0,
  128.     End;
  129.  
  130.     Object->WI_label_0 = WindowObject,
  131.         MUIA_Window_Title, "PegMail 1.0 by Krzynio@fan.com",
  132.         MUIA_Window_ID, MAKE_ID('0', 'W', 'I', 'N'),
  133.         MUIA_Window_AppWindow, TRUE,
  134.         WindowContents, GROUP_ROOT_0,
  135.     End;
  136.  
  137.     Object->App = ApplicationObject,
  138.         MUIA_Application_Author, "Krzynio Koziarek",
  139.         MUIA_Application_Base, "NONE",
  140.         MUIA_Application_Title, "Pegmail",
  141.         MUIA_Application_Version, "$VER: Pegmail 1.0 (26.03.99)",
  142.         MUIA_Application_Copyright, "Krzynio Koziarek",
  143.         MUIA_Application_Description, "Pegasus -> Yam Converter",
  144.         SubWindow, Object->WI_label_0,
  145.     End;
  146.  
  147.  
  148.     if (!Object->App)
  149.     {
  150.         FreeVec(Object);
  151.         return(NULL);
  152.     }
  153.  
  154.     DoMethod(Object->WI_label_0,
  155.         MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
  156.         Object->App,
  157.         2,
  158.         MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit
  159.         );
  160.  
  161.     DoMethod(Object->WI_label_0,
  162.         MUIM_Window_SetCycleChain, Object->PA_label_0,
  163.         Object->PA_label_1,
  164.         Object->BT_quit,
  165.         Object->BT_conv,
  166.         0
  167.         );
  168.  
  169.     set(Object->WI_label_0,
  170.         MUIA_Window_Open, TRUE
  171.         );
  172.  
  173.  
  174.     return(Object);
  175. }
  176.  
  177. void DisposeApp(struct ObjApp * Object)
  178. {
  179.     MUI_DisposeObject(Object->App);
  180.     FreeVec(Object);
  181. }
  182.